<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'MyJsp.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
       #cal{
         width: 600px;
         height:380px;
        
       }
       #cal label{
         font-weight: bold;
         font-size: 16px;
       }
       #cal input{
         height: 20px;
         margin:5px 0px;
       }
       #cal button{
         width: 80px;
         height: 30px;
         margin-top: 10px;
         float: right;
         margin-right: 25px;
       }
    
    </style>
    
    <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
      function jiaoyan(){
         var start=document.getElementById("start").value;
         //alert(start);
         var end=document.getElementById("end").value;
         
         var time1=new Date(start.replace("-","/").replace("-","/"));
         var time2=new Date(end.replace("-","/").replace("-","/"));
         
         if(time1>time2){
          
          alert("结束时间小于开始时间！");
          document.getElementById("myform").action="";
		  
		  return false;	          
         }
         
      }
      function jy(){
         var start=document.getElementById("start").value;
         var color=document.getElementById("color").value;
         var title=document.getElementById("title").value;
         
         if(start==null||color==null||title==null||start==""||color==""||title==""){
           
           alert("字段添加不能为空！ ");
           return false;
         }
      
      
      }
      
    </script>
    
  </head>
  
  <body>
  
    <div name="calender" id="cal" >
      <form action="yz/CalendarActionadd" method="post" id="myform" onsubmit="return jy()">
        <!-- 全天时间: -->
        <input type="hidden" name="calendar.allday" value="1" />
    	<label>开始时间：</label>
    	<input type="text" id="start" name="calendar.start" onclick="WdatePicker(WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null}))" value="${param.date}" size="27" />
    	<label>结束时间：</label>
    	<input type="text" id="end" name="calendar.end" onclick="WdatePicker(WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null}))" size="27" /><br>
    	<label>会议地点：</label>
    	<input type="text" name="calendar.color" size="80" id="color" /><br>
    	<label>会议内容：</label>
    	<textarea cols="70" rows="10" id="title" name="calendar.title" ></textarea><br>
    	<button type="submit" onclick="return jiaoyan()">提交</button>
      </form>
    </div>
  </body>
</html>
